import request from '@/utils/request'


// 添加购物车
export const addCart = (
  goodsId,
  goodsNum,
  goodsSkuId) => {
  return request.post('/cart/add', {
    goodsId,
    goodsNum,
    goodsSkuId
  })
}

// 查询购物车列表
export const getCartList = () => {
  return request.get('/cart/list')
}

// 更新购物车列表
export const updateCartList = (
  goodsId,
  goodsNum,
  goodsSkuId
) => {
  return request.post('/cart/update', {
    goodsId,
    goodsNum,
    goodsSkuId
  })
}

// 删除商品列表
export const deleteCartList = (cartIds) => {
  return request.post('/cart/clear', {
    cartIds
  })
}